import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { AuthService } from './auth.service';
import { CreateAuthDto } from './dto/create-auth.dto';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { Public } from 'src/common/public.decorator';

@ApiTags('权限模块')
@Controller('auth')
export class AuthController {
  constructor(private readonly authService: AuthService) { }

  // 注册
  @ApiOperation({ summary: '注册' })
  @Post('signup')
  signup(@Body() signupData: CreateAuthDto) {
    return this.authService.signup(signupData);
  }

  // 登录
  @ApiOperation({ summary: '登录' })
  @Public()
  @Post('login')
  login(@Body() loginData: CreateAuthDto) {
    return this.authService.login(loginData);
  }
}
